package pe.gob.essalud.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;
import org.springframework.context.annotation.Import;
import org.springframework.context.support.ResourceBundleMessageSource;

@Configuration
// Specifies the class as configuration
@ComponentScan("pe.gob.essalud")
// Imports another configuration's classes
@Import({ PersistenceConfig.class, SecurityConfig.class, MvcConfig.class })
// Specifies which package to scan
public class WebAppConfig{

	@Bean
	@Description("Spring message resolver")
	public ResourceBundleMessageSource messageSource() {
		ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource();
		messageSource.setBasename("messages");
		return messageSource;
	}
	
}
